package com.tms.app.tms.ui.base.presenter;

import com.tms.app.tms.app.Constant;
import com.tms.app.tms.app.MyApp;
import com.tms.app.tms.bean.GpsBean;
import com.tms.app.tms.bean.response.BaseResponse;
import com.tms.app.tms.bean.response.FeeNameRes;

import org.xutils.DbManager;
import org.xutils.db.sqlite.SqlInfo;
import org.xutils.db.sqlite.WhereBuilder;
import org.xutils.ex.DbException;
import org.xutils.http.RequestParams;
import org.xutils.x;

import java.util.List;

/**
 * Created by Administrator on 2017/12/1 0001.
 */

public class ComPresenter extends BaseListPresenter {
    @Override
    public void onSuccess(String result) {
        super.onSuccess(result);
        if (requestType==2){
            FeeNameRes b=gson.fromJson(result,FeeNameRes.class);
            sendMsgToView(b);
        }else {
            sendMsgToView(result);
        }


    }

    public void loginOut(String token) {
        requestType=1;
        RequestParams params=new RequestParams(Constant.LoginOut);
        params.addBodyParameter("token",token);
        getObjectFromServer(params,1);
    }

    public void saveFee(RequestParams params) {
        requestType=1;
        getObjectFromServer(params,1);
    }

    public void getFeeList(){
        requestType=2;
        RequestParams params=new RequestParams(Constant.feeList);
        params.addBodyParameter("feeType","3");
        getObjectFromServer(params,1);

    }



}
